-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move constants required by UserInterface into interface definition #8896
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8896 +/- ##
=============================================
- Coverage 51.82% 31.49% -20.33%
Complexity 25281 25281
=============================================
Files 1604 1604
Lines 94804 94804
Branches 1377 1377
=============================================
- Hits 49131 29863 -19268
- Misses 45673 64941 +19268
|
@@ -39,14 +39,25 @@ | |||
* @since 4.5.0 | |||
*/ | |||
interface UserInterface { | |||
/** | |||
* actions that user backends can define |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a @since 14.0.0
tag so everybody knows when this was added and with what version it could be used.
I still don't like the overall approach of how we implemented the user backends. I have in mind, that we discussed a bit more about distinct user backend interfaces for all of those constants. Something like As short term solution this still is okay, but we maybe should think about how to make it properly maintainable. ;) |
I agree with Morris that we should move away from this. And then adding it to the public interface doesn't make it easier as we have a long depreciation period. |
As I pointed out in #8895 this is just a suggestion. Of course I am not in the position to decide which interface is supposed to be public or not, but let me explain my motivation: I have written my own user backend which implements these public interfaces. Whenever I look at the code I feel quite good about the fact that I am only using public interfaces. There is only one place where the And I also agree that the current situation with the user backend stuff is far from optimal at the moment. That's why I also suggested in #8895 that another approach could be to provide a public abstract user backend class instead of just the interface definitions. More code from |
lib/public/UserInterface.php
Outdated
|
||
/** | ||
* Check if backend implements actions | ||
* @param int $actions bitwise-or'ed actions | ||
* @return boolean | ||
* | ||
* Returns the supported actions as int to be | ||
* compared with \OC\User\Backend::CREATE_USER etc. | ||
* compared with CREATE_USER etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self::CREATE_USER
but doesn't matter a lot I guess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nickvergessen You are right, I have updated the comment and rebased my PR in order to keep the number of commits down.
The constants which need to be checked in `implementsActions` formerly resided in the private \OC\User\Backend class. Since they need to be accessed in apps they should actually reside in the public interface. Signed-off-by: Daniel Klaffenbach <daniel.klaffenbach@hrz.tu-chemnitz.de>
Let's wait for CI. |
Had a chat with @rullzer on IRC and it would maybe make sense to move the dedicated interfaces approach forward. Because this then would be a clean approach to tackle the underlying problem. |
@klada Let's leave this open for some days and we will look into how easy it is to go the proper way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking. See my previous comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking 😉
See #8935 |
Ok lets close this then and continue in #8935 |
The constants which need to be checked in
implementsActions
formerlyresided in the private \OC\User\Backend class. Since they need to be
accessed in apps they should actually reside in the public interface.
Closes #8895